#ifndef _MAIN_CAN_H_
#define _MAIN_CAN_H_

#include <stdint.h>

typedef enum
{
    EM_CTRL_TYPE_IO = 1,

}EM_CTRL_TYPE_t;

typedef enum
{
    EM_IO_CHG = 1,
    EM_IO_ON ,
    EM_IO_CC2 ,
}EM_IO_CHL_t;

typedef enum
{
    EM_IO_H = 1,
    EM_IO_L ,
}EM_IO_ST_t;

#pragma pack(push)
#pragma pack(1)

typedef union
{
    uint8_t data[64];
        /*BMU*/
    struct
    {
        uint8_t  life;
        uint8_t  tmpChip;
        uint16_t Vrefin;
        uint16_t power;
        uint16_t hallvol;
    }mes;
}MAIN_TX_MES1_t;

typedef union
{
    uint8_t data[64];
        /*BMU*/
    struct
    {
        uint8_t ctrl_type;
        uint8_t io_ch:4;
        uint8_t ic_st:4;
    }mes;
}MAIN_RX_MES1_t;

#pragma pack(pop)

typedef struct
{
    EM_CTRL_TYPE_t  ctrl_type;
    EM_IO_CHL_t     io_chl;
    EM_IO_ST_t      io_st;
    MAIN_TX_MES1_t  mainTxMes1;
    MAIN_RX_MES1_t  mainRxMes1;
}APP_main_can_t;


extern APP_main_can_t app_main_can;

void app_main_can_rx_run(void);
void app_main_can_tx_run(void);

#endif

